$(document).ready(function(){
	var loc = window.location.href.toString().split("/"); // 현재 주소
	var loc_h=loc[loc.length-1].split(".html");
	var loc_h_=loc_h[0].split("_");
	var loc_html=loc_h_[0];

	if(loc_html=="notice"){
	$(".main_menu ul li:eq(0) a img").attr('src','../res/img/bell_white.png');
	$('.main_menu ul li a').hover(
		function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
				
			switch(idx){
				case 0 : break;
				case 1 : OImg.attr('src','../res/img/note_white.png');break;
				case 2 : OImg.attr('src','../res/img/man_white.png');break;
				case 3 : OImg.attr('src','../res/img/cal_white.png');break;
				case 4 : OImg.attr('src','../res/img/medal_white.png');break;
				case 5 : OImg.attr('src','../res/img/star_white.png');break;
				}
		},function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
			switch(idx){
				case 0 : break;
				case 1 : OImg.attr('src','../res/img/note_gray.png');break;
				case 2 : OImg.attr('src','../res/img/man_gray.png');break;
				case 3 : OImg.attr('src','../res/img/cal_gray.png');break;
				case 4 : OImg.attr('src','../res/img/medal_gray.png');break;
				case 5 : OImg.attr('src','../res/img/star_gray.png');break;
			}
		});
	}else if(loc_html=="apply"  ){
		$(".main_menu ul li:eq(1) a img").attr('src','../res/img/note_white.png');
		$('.main_menu ul li a').hover(
		function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
				
			switch(idx){
				case 0 : OImg.attr('src','../res/img/bell_white.png');break;
				case 1 : break;
				case 2 : OImg.attr('src','../res/img/man_white.png');break;
				case 3 : OImg.attr('src','../res/img/cal_white.png');break;
				case 4 : OImg.attr('src','../res/img/medal_white.png');break;
				case 5 : OImg.attr('src','../res/img/star_white.png');break;
				}
		},function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
			switch(idx){
				case 0 : OImg.attr('src','../res/img/bell_gray.png');break;
				case 1 : break;
				case 2 : OImg.attr('src','../res/img/man_gray.png');break;
				case 3 : OImg.attr('src','../res/img/cal_gray.png');break;
				case 4 : OImg.attr('src','../res/img/medal_gray.png');break;
				case 5 : OImg.attr('src','../res/img/star_gray.png');break;
			}
		});
	}else if(loc_html=="contest" ){
	$(".main_menu ul li:eq(2) a img").attr('src','../res/img/man_white.png');
	$('.main_menu ul li a').hover(
		function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
				
			switch(idx){
				case 0 : OImg.attr('src','../res/img/bell_white.png');break;
				case 1 : OImg.attr('src','../res/img/note_white.png');break;
				case 2 : break;
				case 3 : OImg.attr('src','../res/img/cal_white.png');break;
				case 4 : OImg.attr('src','../res/img/medal_white.png');break;
				case 5 : OImg.attr('src','../res/img/star_white.png');break;
				}
		},function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
			switch(idx){
				case 0 : OImg.attr('src','../res/img/bell_gray.png');break;
				case 1 : OImg.attr('src','../res/img/note_gray.png');break;
				case 2 : break;
				case 3 : OImg.attr('src','../res/img/cal_gray.png');break;
				case 4 : OImg.attr('src','../res/img/medal_gray.png');break;
				case 5 : OImg.attr('src','../res/img/star_gray.png');break;
			}
		});
	}else if(loc_html=="schedule" ){
	$(".main_menu ul li:eq(3) a img").attr('src','../res/img/cal_white.png');
	$('.main_menu ul li a').hover(
		function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
				
			switch(idx){
				case 0 : OImg.attr('src','../res/img/bell_white.png');break;
				case 1 : OImg.attr('src','../res/img/note_white.png');break;
				case 2 : OImg.attr('src','../res/img/man_white.png');break;
				case 3 : break;
				case 4 : OImg.attr('src','../res/img/medal_white.png');break;
				case 5 : OImg.attr('src','../res/img/star_white.png');break;
				}
		},function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
			switch(idx){
				case 0 : OImg.attr('src','../res/img/bell_gray.png');break;
				case 1 : OImg.attr('src','../res/img/note_gray.png');break;
				case 2 : OImg.attr('src','../res/img/man_gray.png');break;
				case 3 : break;
				case 4 : OImg.attr('src','../res/img/medal_gray.png');break;
				case 5 : OImg.attr('src','../res/img/star_gray.png');break;
			}
		});
	}else if(loc_html=="results" ){
	$(".main_menu ul li:eq(4) a img").attr('src','../res/img/medal_white.png');
	$('.main_menu ul li a').hover(
		function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
				
			switch(idx){
				case 0 : OImg.attr('src','../res/img/bell_white.png');break;
				case 1 : OImg.attr('src','../res/img/note_white.png');break;
				case 2 : OImg.attr('src','../res/img/man_white.png');break;
				case 3 : OImg.attr('src','../res/img/cal_white.png');break;
				case 4 : break;
				case 5 : OImg.attr('src','../res/img/star_white.png');break;
				}
		},function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
			switch(idx){
				case 0 : OImg.attr('src','../res/img/bell_gray.png');break;
				case 1 : OImg.attr('src','../res/img/note_gray.png');break;
				case 2 : OImg.attr('src','../res/img/man_gray.png');break;
				case 3 : OImg.attr('src','../res/img/cal_gray.png'); break;
				case 4 : break;
				case 5 : OImg.attr('src','../res/img/star_gray.png');break;
			}
		});
	}else{
	$('.main_menu ul li a').hover(
		function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
				
			switch(idx){
				case 0 : OImg.attr('src','../res/img/bell_white.png');break;
				case 1 : OImg.attr('src','../res/img/note_white.png');break;
				case 2 : OImg.attr('src','../res/img/man_white.png');break;
				case 3 : OImg.attr('src','../res/img/cal_white.png');break;
				case 4 : OImg.attr('src','../res/img/medal_white.png');break;
				case 5 : OImg.attr('src','../res/img/star_white.png');break;
				}
		},function(){
			var idx= $(this).parent().index();
			var OImg= $(".main_menu ul li:eq("+idx+") a img");
			switch(idx){
				case 0 : OImg.attr('src','../res/img/bell_gray.png');break;
				case 1 : OImg.attr('src','../res/img/note_gray.png');break;
				case 2 : OImg.attr('src','../res/img/man_gray.png');break;
				case 3 : OImg.attr('src','../res/img/cal_gray.png');break;
				case 4 : OImg.attr('src','../res/img/medal_gray.png');break;
				case 5 : OImg.attr('src','../res/img/star_gray.png');break;
			}
		});
	}
	$('#logo a img').hover(
	function(){
		$(this).attr('src','../res/img/logo_white.png').css({'width' :'275px','height' : '100px','margin':'0'});
	},function(){
		$(this).attr('src','../res/img/logo_gray.png').css({'width' :'273px','height' : '82px','margin':'9px 20px 10px 0'})
	});
});